// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIEventListenerService.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// Contains an event target along with an array of nsIAtom in form "oneventname"
    /// representing changed event listener names.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("07222b02-da12-4cf4-b2f7-761da007a8d8")]
	public interface nsIEventListenerChange
	{
		
		/// <summary>
        /// Contains an event target along with an array of nsIAtom in form "oneventname"
        /// representing changed event listener names.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDOMEventTarget GetTargetAttribute();
		
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIArray GetChangedListenerNamesAttribute();
	}
	
	/// <summary>nsIListenerChangeListener </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("aa7c95f6-d3b5-44b3-9597-1d9f19b9c5f2")]
	public interface nsIListenerChangeListener
	{
		
		/// <summary>Member ListenersChanged </summary>
		/// <param name='aEventListenerChanges'> </param>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ListenersChanged([MarshalAs(UnmanagedType.Interface)] nsIArray aEventListenerChanges);
	}
	
	/// <summary>
    /// An instance of this interface describes how an event listener
    /// was added to an event target.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("11ba5fd7-8db2-4b1a-9f67-342cfa11afad")]
	public interface nsIEventListenerInfo
	{
		
		/// <summary>
        /// The type of the event for which the listener was added.
        /// Null if the listener is for all the events.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetTypeAttribute([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aType);
		
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetCapturingAttribute();
		
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetAllowsUntrustedAttribute();
		
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetInSystemEventGroupAttribute();
		
		/// <summary>
        /// The underlying JS object of the event listener, if this listener
        /// has one.  Null otherwise.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		Gecko.JsVal GetListenerObjectAttribute(System.IntPtr jsContext);
		
		/// <summary>
        /// Tries to serialize event listener to a string.
        /// Returns null if serialization isn't possible
        /// (for example with C++ listeners).
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ToSource([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase retval);
	}
	
	/// <summary>nsIEventListenerService </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("77aab5f7-213d-4db4-9f22-e46dfb774f15")]
	public interface nsIEventListenerService
	{
		
		/// <summary>
        /// Returns an array of nsIEventListenerInfo objects.
        /// If aEventTarget doesn't have any listeners, this returns null.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetListenerInfoFor([MarshalAs(UnmanagedType.Interface)] nsIDOMEventTarget aEventTarget, ref uint aCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] ref nsIEventListenerInfo[] aOutArray);
		
		/// <summary>
        /// Returns an array of event targets.
        /// aEventTarget will be at index 0.
        /// The objects are the ones that would be used as DOMEvent.currentTarget while
        /// dispatching an event to aEventTarget
        /// @note Some events, especially 'load', may actually have a shorter
        /// event target chain than what this methods returns.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetEventTargetChainFor([MarshalAs(UnmanagedType.Interface)] nsIDOMEventTarget aEventTarget, ref uint aCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] ref nsIDOMEventTarget[] aOutArray);
		
		/// <summary>
        /// Returns true if a event target has any listener for the given type.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool HasListenersFor([MarshalAs(UnmanagedType.Interface)] nsIDOMEventTarget aEventTarget, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aType);
		
		/// <summary>
        /// Add a system-group eventlistener to a event target.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void AddSystemEventListener([MarshalAs(UnmanagedType.Interface)] nsIDOMEventTarget target, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase type, [MarshalAs(UnmanagedType.Interface)] nsIDOMEventListener listener, [MarshalAs(UnmanagedType.U1)] bool useCapture);
		
		/// <summary>
        /// Remove a system-group eventlistener from a event target.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void RemoveSystemEventListener([MarshalAs(UnmanagedType.Interface)] nsIDOMEventTarget target, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase type, [MarshalAs(UnmanagedType.Interface)] nsIDOMEventListener listener, [MarshalAs(UnmanagedType.U1)] bool useCapture);
		
		/// <summary>Member AddListenerForAllEvents </summary>
		/// <param name='target'> </param>
		/// <param name='listener'> </param>
		/// <param name='aUseCapture'> </param>
		/// <param name='aWantsUntrusted'> </param>
		/// <param name='aSystemEventGroup'> </param>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void AddListenerForAllEvents([MarshalAs(UnmanagedType.Interface)] nsIDOMEventTarget target, [MarshalAs(UnmanagedType.Interface)] nsIDOMEventListener listener, [MarshalAs(UnmanagedType.U1)] bool aUseCapture, [MarshalAs(UnmanagedType.U1)] bool aWantsUntrusted, [MarshalAs(UnmanagedType.U1)] bool aSystemEventGroup);
		
		/// <summary>Member RemoveListenerForAllEvents </summary>
		/// <param name='target'> </param>
		/// <param name='listener'> </param>
		/// <param name='aUseCapture'> </param>
		/// <param name='aSystemEventGroup'> </param>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void RemoveListenerForAllEvents([MarshalAs(UnmanagedType.Interface)] nsIDOMEventTarget target, [MarshalAs(UnmanagedType.Interface)] nsIDOMEventListener listener, [MarshalAs(UnmanagedType.U1)] bool aUseCapture, [MarshalAs(UnmanagedType.U1)] bool aSystemEventGroup);
		
		/// <summary>Member AddListenerChangeListener </summary>
		/// <param name='aListener'> </param>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void AddListenerChangeListener([MarshalAs(UnmanagedType.Interface)] nsIListenerChangeListener aListener);
		
		/// <summary>Member RemoveListenerChangeListener </summary>
		/// <param name='aListener'> </param>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void RemoveListenerChangeListener([MarshalAs(UnmanagedType.Interface)] nsIListenerChangeListener aListener);
	}
}
